<?php

/**
 * LigneFactureClient form base class.
 *
 * @method LigneFactureClient getObject() Returns the current form's model object
 *
 * @package    SdCommerce
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseLigneFactureClientForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                 => new sfWidgetFormInputHidden(),
      'designation'        => new sfWidgetFormInputText(),
      'taux_remise'        => new sfWidgetFormInputText(),
      'quantite_livre'     => new sfWidgetFormInputText(),
      'quantite'           => new sfWidgetFormInputText(),
      'quantite_rendue'    => new sfWidgetFormInputText(),
      'poids_net'          => new sfWidgetFormInputText(),
      'poids_brut'         => new sfWidgetFormInputText(),
      'prix_unitaire_ht'   => new sfWidgetFormInputText(),
      'prix_total_ht'      => new sfWidgetFormInputText(),
      'prix_total_tttc'    => new sfWidgetFormInputText(),
      'prix_total_ttcnet'  => new sfWidgetFormInputText(),
      'prix_tva'           => new sfWidgetFormInputText(),
      'stock_article_id'   => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('StockArticle'), 'add_empty' => true)),
      'article_serieid'    => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('ArticleSerie'), 'add_empty' => true)),
      'facture_client_id'  => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('FactureClient'), 'add_empty' => false)),
      'tva_id'             => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Tva'), 'add_empty' => true)),
      'maintenance_id'     => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Maintenance'), 'add_empty' => true)),
      'departement_id'     => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Departement'), 'add_empty' => true)),
      'unite_logistiqueid' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('UniteLogistique'), 'add_empty' => true)),
      'r'                  => new sfWidgetFormInputText(),
      'q'                  => new sfWidgetFormInputText(),
      'deleted_at'         => new sfWidgetFormDate(),
      'created_at'         => new sfWidgetFormDateTime(),
      'updated_at'         => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'                 => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'designation'        => new sfValidatorString(array('max_length' => 100)),
      'taux_remise'        => new sfValidatorNumber(),
      'quantite_livre'     => new sfValidatorNumber(),
      'quantite'           => new sfValidatorNumber(),
      'quantite_rendue'    => new sfValidatorNumber(),
      'poids_net'          => new sfValidatorNumber(),
      'poids_brut'         => new sfValidatorNumber(),
      'prix_unitaire_ht'   => new sfValidatorNumber(),
      'prix_total_ht'      => new sfValidatorNumber(),
      'prix_total_tttc'    => new sfValidatorNumber(),
      'prix_total_ttcnet'  => new sfValidatorNumber(),
      'prix_tva'           => new sfValidatorNumber(),
      'stock_article_id'   => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('StockArticle'), 'required' => false)),
      'article_serieid'    => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('ArticleSerie'), 'required' => false)),
      'facture_client_id'  => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('FactureClient'))),
      'tva_id'             => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Tva'), 'required' => false)),
      'maintenance_id'     => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Maintenance'), 'required' => false)),
      'departement_id'     => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Departement'), 'required' => false)),
      'unite_logistiqueid' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('UniteLogistique'), 'required' => false)),
      'r'                  => new sfValidatorInteger(),
      'q'                  => new sfValidatorNumber(),
      'deleted_at'         => new sfValidatorDate(array('required' => false)),
      'created_at'         => new sfValidatorDateTime(),
      'updated_at'         => new sfValidatorDateTime(),
    ));

    $this->widgetSchema->setNameFormat('ligne_facture_client[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'LigneFactureClient';
  }

}
